interface IExcute
{
    operate():void;
}

class Commander
{
    excuteObject:IExcute;

    constructor(excuteObjectParm:IExcute)
    {
        this.excuteObject = excuteObjectParm;
    }
    action():void
    {
        this.excuteObject.operate();
    }
}

class AirForceCommander extends Commander
{
   action():void
   {
       console.log("run in air force commander");
       super.action();
   }
}

class SpecialForceCommander extends Commander
{
    action():void
    {
        console.log("run in special force commander");
        super.action();
    }
}

class Pilot implements IExcute
{
    operate(): void {
       console.log("Pilot");
    }
}

class Soldier implements IExcute
{
    operate():void
    {
        console.log("Shoot");
    }
}

export class BridgeAction
{
    test():void
    {
       const airCommander = new AirForceCommander(new Pilot());
       const specialCommander = new SpecialForceCommander(new Soldier());
       airCommander.action();
       specialCommander.action();
    }
}